package com.training.java.core.collections.car.pre15;

public class Television implements Comparable<Television> {

	private String company;
	private String type;
	private boolean threeDEnabled;
	private int price;

	public Television() {
	}

	public Television(String company, String type, boolean threeDEnabled) {
		this.company = company;
		this.type = type;
		this.threeDEnabled = threeDEnabled;
	}

	public String getCompany() {
		return company;
	}

	public String getType() {
		return type;
	}

	public boolean isThreeDEnabled() {
		return threeDEnabled;
	}

	public int getPrice() {
		return price;
	}

	public void setPrice(int price) {
		this.price = price;
	}

	@Override
	public boolean equals(Object obj) {
		if (obj instanceof Television) {
			Television tv = (Television) obj;
			return (this.company.equals(tv.company))
					&& (this.type.equals(tv.type)) && (this.price == tv.price);
		} else {
			return false;
		}
	}

	@Override
	public int compareTo(Television tv) {

		return this.company.compareTo(tv.company);
	}

	@Override
	public int hashCode() {

		return this.company.hashCode() + this.type.hashCode() + this.price;
	}

}
